home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.2
/
Video Toaster v4.2.iso
/
arexx
/
modeler
/
toroid.lwm
< prev
next >
Wrap
Text File
|
1993-12-13
|
2KB
|
85 lines
/* CMD: Toroid
* Make Torus section in Modeler */
/* By Arnie Cachelin Copyright © 1992 NewTek, Inc. */
arg angle startangle name
if angle="" then angle=360
if startangle="" then startangle=0
segs=abs(angle-startangle)%5 /* approx 5 deg per slice */
Ax='Y'
libadd = addlib("LWModelerARexx.port",0)
signal on error
signal on syntax
if name="" then name="Torus"
else name=strip(name)
call req_begin "Toroid"
AxId = req_addcontrol("Axis", "CH",'X Y Z')
SegId = req_addcontrol("Segments",'N')
SidId = req_addcontrol("Sides",'N')
RadId = req_addcontrol("Radius",'N',0)
StAngId = req_addcontrol("Start Angle",'N',0)
AngId = req_addcontrol("End Angle",'N',0)
XSecId = req_addcontrol("XSection",'V',0)
SurfId = req_addcontrol("Surface",'R')
call req_setval SegId, 16,16
call req_setval SidId, 16,16
call req_setval AxId, 2
call req_setval RadId, 1,1
call req_setval XSecId,'0.5 0.5 0.5' 0.50
call req_setval StAngId, startangle
call req_setval AngId, angle
x = req_post()
if (x) then do
segs= req_getval(SegId)
sides= req_getval(SidId)
Ax= req_getval(AxId)
r=req_getval(RadId)
xsec= req_getval(XSecId)
/* xsec=translate(xsec,',',' ') */
name= req_getval(SurfId)
startangle= req_getval(StAngId)
angle= req_getval(AngId)
call req_end()
end
else do
call req_end()
exit
end
if Ax=1 then do
Ax='X'
lax='Z'
cen='0 'r' 0'
end
else if Ax=2 then do
Ax='Y'
lax='Z'
cen=r*1.0' 0 0'
end
else if Ax=3 then do
Ax='Z'
lax='Y'
cen=r*1.0' 0 0'
end
/* Need to clear out objects, or they will be lathed too! :( */
call CUT()
call SURFACE(name)
call MAKEDISC(xsec,0,0,lax,sides,1,cen)
call LATHE(Ax,segs,0,angle,startangle)
call PASTE() /* Replace stuff we cleared out :) */
exit
syntax:
error:
call end_all
t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
exit